package com.adds.lvds.security.model;

import java.util.List;

import com.adds.lvds.model.organize.SysOrgInfo;
import com.adds.lvds.model.organize.SysUserInfo;
import com.adds.lvds.model.organize.SysUserPermission;

/**
 * @author Administrator
 *
 */
public class SysCurrentUser {
	public static final String LVDS_CURRENT_USER_OBJECT_KEY = "LVDS_CURRENT_USER_OBJECT";
	private Integer id;

	private String userName;// 账号名

	private String password;// 密码

	private String description;// 说明

	private Integer state;// 账号状态 0 表示停用 1表示启用
	
	private Integer operator; // 创建人id

	private String createTime; // 创建时间

	private String updateTime; // 更新时间
    private int online;//1 在线 0 不在线
	private String head_img;
	// 获取用户详情数据
	private SysUserInfo sysUserInfo;
	// 获取所在组织机构数据
	private List<SysOrgInfo> sysOrgInfo;
	//角色数据
	private List<SysRole> roleList;
	//机构范围权限
	private SysUserPermission sysUserPermission;
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public Integer getOperator() {
		return operator;
	}

	public void setOperator(Integer operator) {
		this.operator = operator;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	public int getOnline() {
		return online;
	}

	public void setOnline(int online) {
		this.online = online;
	}

	public String getHead_img() {
		return head_img;
	}

	public void setHead_img(String head_img) {
		this.head_img = head_img;
	}

	public SysUserInfo getSysUserInfo() {
		return sysUserInfo;
	}

	public void setSysUserInfo(SysUserInfo sysUserInfo) {
		this.sysUserInfo = sysUserInfo;
	}
	

	public static String getLvdsCurrentUserObjectKey() {
		return LVDS_CURRENT_USER_OBJECT_KEY;
	}

	public List<SysOrgInfo> getSysOrgInfo() {
		return sysOrgInfo;
	}

	public void setSysOrgInfo(List<SysOrgInfo> sysOrgInfo) {
		this.sysOrgInfo = sysOrgInfo;
	}

	public List<SysRole> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<SysRole> roleList) {
		this.roleList = roleList;
	}

	public String getRoleName() {
		String roleName = "";
		if (roleList != null) {
			for (SysRole role : roleList) {
				roleName += "".equals(roleName) ? role.getName() : ","
						+ role.getName();
			}
		}
		return roleName;
	}

	public SysUserPermission getSysUserPermission() {
		return sysUserPermission;
	}

	public void setSysUserPermission(SysUserPermission sysUserPermission) {
		this.sysUserPermission = sysUserPermission;
	}

	@Override
	public String toString() {
		return "SysCurrentUser [id=" + id + ", userName=" + userName
				+ ", password=" + password + ", description=" + description
				+ ", state=" + state + ", createTime=" + createTime
				+ ", updateTime=" + updateTime + ", headimg=" + head_img
				+ ", sysUserInfo=" + sysUserInfo + ", sysOrgInfo=" + sysOrgInfo
				+ ", roleList=" + roleList + "]";
				
	}
	
	

}
